package com.learner.ucenter.repository;

import com.learner.pojo.user.User;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

/**
 * @Author ice2020x
 * @Date 2023-02-24 16:37
 * @Description:
 */
@Repository
public interface UserDao  extends MongoRepository<User, String> {

    /**
     * 根据用户名或者code查询用户
     * @param username username
     * @param nickname nickname
     * @return User 用户信息
     */
    User findUserByUsernameOrNickname(String username, String nickname);

    /**
     * 根据用户名查询用户
     * @param username username
     * @return User 用户信息
     */
    User findUserByUsername(String username);
}
